The present invention relates to a curve edition system included in an image processing technique which is employed in an industrial field of a CAD and an image producing field and arranged to edit boundary curves indicating a border of an object included in an image, a curve-loop detecting system for detecting a loop formed owing to edition of the boundary curves, a curve-loop removing system for removing a loop formed by the boundary curves.
2. Description of the Related Art
A conventional technique for producing key signals by extracting the border of an object in an image is a basic and important image processing technique which is applied to a variety of fields including recognition of an object and tracking and synthesis of images. The key signal includes a so-called hard key which uses binary codes such that the value of a foreground image is made to be one and value of a background image is made to be zero. Another key signal is a soft key with which the border of an object is constituted by two border curves and the value of the foreground image and the value of the background are gradually changed from zero to one.
The conventional methods of producing the soft keys have a main step that an adequate inclination is provided for a border portion of each hard key. For example, xe2x80x9cIMAGE SYNTHESIZING APPARATUSxe2x80x9d disclosed in Japanese Patent Laid-Open No. 60-232787 has a step of extracting only the border portions of an object in accordance with the hard keys to smooth the image. Another method of producing soft keys has a step of using signals of hard keys to subject only the border portions of the object to a process using a low-pass filter to blur away the border portions of the object so as to obtain a smooth image.
In Japanese Patent Laid-Open No. 4-340671, xe2x80x9cANTI-ALIASING METHODxe2x80x9d has been disclosed with which image blocks are set around a certain pixel of interest in the border portion of an object so as to produce soft keys in accordance with patterns of pixels in the foreground images and the background images in the pixel blocks. The soft keys produced by each of the foregoing methods cannot usually overcome motion blur which occurs when an object is moving because uniform inclinations are provided for the border portions of the object.
A conventional method for producing soft keys by factoring in the motion blur of a dynamic image has been disclosed in, for example, Japanese Patent Laid-Open No. 5-153493. The foregoing method has the step of making a present image of a dynamic image and an immediately preceding image to a comparison to obtain the total sum of variations of pixels at each position of an object. In accordance with the magnitude of the variation, the width of the soft key is determined. However, the foregoing method does not permit a user to easily change a curved surface because the curved surface of the soft key is not controlled.
A technique of producing soft keys has been disclosed in Japanese Patent Laid-Open No. 5-236347 under the title of xe2x80x9cSOFT-KEY PRODUCING APPARATUSxe2x80x9d. According to the foregoing disclosure, soft keys are produced by performing a process for shaving a hard key with an elliptic cone at each point on the border of an object. The foregoing method is performed such that the motion vector of a portion of interest and the gradient of the image are calculated so as to determine the major axis and the minor axis of the ellipse which is the bottom surface of the elliptic cone. The control of the technique for producing soft keys is performed by using the motion vector and the intensity of the edge to determine the major and minor axes. Hence it follows that the reflection of the motion vector and the intensity of the edge on the produced soft key cannot easily be determined. The foregoing technique for producing soft keys has a step of performing an indirect process for producing soft keys by shaving the hard keys in place of direct production of the soft keys. Therefore, the reflection of the control of the produced soft key cannot easily be determined. As a result, the foregoing technique for producing soft keys does not permit a user to easily perform a required change when the user requires change of a portion of the soft keys.
A conventional technique for producing soft keys has been disclosed in Japanese Patent Laid-Open No. 8-331445 under the title of xe2x80x9cAPPARATUS FOR PRODUCING SOFT KEYxe2x80x9d. The foregoing technique for producing soft keys employs curved surfaces to express the border portions. Therefore, the foregoing method is able to correspond to local changes in the widths of the soft keys on the border. A technique for producing soft keys disclosed in Japanese Patent Laid-Open No. 9-37153 under the title of xe2x80x9cKEY-SIGNAL CALCULATING APPARATUS AND METHOD THEREFORxe2x80x9d uses changes in the values of pixels to automate calculations of the key signals so as to enable the width of the soft key to be calculated.
The xe2x80x9cAPPARATUS FOR PRODUCING SOFT KEYxe2x80x9d disclosed in Japanese Patent Laid-Open No. 8-331445 and xe2x80x9cKEY-SIGNAL CALCULATING APPARATUS AND METHOD THEREFORxe2x80x9d disclosed in Japanese Patent Laid-Open No. 9-37153 have a problem. That is, direct use of the soft key having the width obtained from change in the value of the pixel in a process for synthesizing images results in leakage of the color of the background to the synthesized image. Therefore, edition processes must be performed by a user such that the width of the soft key in the border portion is adjusted and the overall image is moved outwards/inwards.
When a soft key having a width is edited, projection to a flat image display unit is required. When an assumption is made that the mixture ratio of the foreground image and the background image is a, edition is permitted by performing expression using two curves at xcex1=0 and xcex1=1. That is, the two curves form a shape surrounding the border owing to the characteristic of the key curved surface. Therefore, the two curves have a close relationship with the shape of the border of the object. To maintain consistency of the shape of the key curved surface, intersection of the curves must be prevented.
In an example case in which two border curves A0 and A1 as shown in FIG. 1A are edited to totally and inwards move central line pcxe2x80x2 to central line pcxe2x80x2 as shown in FIG. 1B and the border curves are A0xe2x80x2 and A1xe2x80x2, a loop is undesirably formed at the internal border curve A1xe2x80x2 of the two border curves A0xe2x80x2 and A1xe2x80x2. In another example case in which border curves A0 and A1 shown in FIG. 2A are deformed into border curves A0xe2x80x2 and A1xe2x80x2 shown in FIG. 2B and the width is changed from W to Wxe2x80x2, also loop is undesirably formed.
To edit two border curves, a method has usually been employed with which each border curve is edited. That is, a uniform process of the two curves cannot be performed. What is worse, the foregoing method has a problem in that the width of the curve is changed unintentionally for a user owing to no relationship with the direction of the border.
In view of the foregoing, an object of the present invention is to provide a curve edition system which is capable of easily editing two curves indicating the border of an object in an image.
Another object of the present invention is to provide a curve edition, curve loop detection, and curve loop removing system which is capable of detecting and removing a loop formed owing to edition of a curve representing the border of an object in an image.
To achieve the foregoing objects, according to one aspect of the present invention, there is provided a curve edition apparatus comprising: converting means for converting two curves indicating positions of inner and outer boundaries of a border of an object included in an image to produce a dot sequence for each curve; changing means for changing the coordinates of each point by using the dot sequence of each curve produced by the converting means; and restructuring means for restructuring the two curves from the coordinates of each point having the coordinates changed by the changing means.
The curve edition apparatus structured as described above performs an edition process by changing the coordinates of the dot sequence such that the changing means uses the dot sequences of the curves to change the coordinates, followed by restructuring the two curves from the coordinates of each point having the changed coordinates.
According to another aspect of the present invention, there is provided a curve edition method comprising the steps of: converting two curves indicating positions of inner and outer boundaries of a border of an object included in an image to produce a dot sequence for each curve; changing the coordinates of each point by using the dot sequence of each curve produced by the converting means; and restructuring the two curves from the coordinates of each point having the coordinates changed by the changing means.
The curve edition method according to the present invention is arranged to perform the edition process such that two curves are converted into the dot sequences to change the coordinates of the dot sequences. In this case, the dot sequences for the curves are used to change the coordinates of each point to restructure the two curves from the coordinates of each point having the changed coordinates.
According to another aspect of the present invention, there is provided a curve edition apparatus and a method therefor structured such that the shape of a boundary curve indicating the shape of the border of an object included in an image and formed by a plurality of segments is edited; a loop formed owing to the edition step for each segment is detected for each segment; a loop formed by a plurality of segments is detected: and the detected loop is removed.
The curve edition apparatus and method therefor are arranged such that the loop formed owing to the edition of the boundary curve is removed by detecting a fact that the loop is formed in each segment or a plurality of segments.
According to a curve-loop detecting method and apparatus therefor are structured to determine whether or not a loop is formed by a single segment by forming a boundary curve indicating the border of an object included in an image and by projecting a vector connecting a terminal point and a control point of each segment in the form of a Bezier curve defined by the terminal point and the control point to each other on a straight line so as to detect the direction of the vector; and determine whether or not a loop is formed by a single segment by dividing a segment determined in the rough determining step that the loop is formed by the single -segment and by setting a rectangular region surrounding each segment by connecting a terminal point and a control point of each segment produced owing to the division process to each other so as to determine whether or not the rectangular region are superimposed.
The curve-loop detecting method and apparatus therefor are arranged to perform the precise determination for determining whether or not the loop is formed by a single segment. In accordance with a result of the rough determination, a loop having the possibility that a loop is formed is subjected to the precise determination.
The curve-loop removing method and apparatus therefor according to the present invention are structured to use information about the intersection indicating a fact that a loop is formed because each segment formed by dividing a boundary curve indicating the shape of a border of an object included in an image intersects to extract a plurality of loops made contact with one another at each intersection according to the lengths of the loops, wherein the plurality of loops made contact with one another at the intersection are removed according to the lengths of the loops.
The curve-loop removing method and apparatus therefor are arranged to use information about the intersections to remove a plurality of loops made contact with one another at the intersection according to the lengths of the loops in an ascending order or descending order of the length of the loop.
Other objects, features and advantages of the invention will be evident from the following detailed description of the preferred embodiments described in conjunction with the attached drawings.